<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <link rel="stylesheet" href="/dist/plugins/webuploader-0.1.5/webuploader.css">
    <style>
        [v-cloak] {
            display: none;
        }

        * {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            font-size: 12px;
        }

        body {
            margin: 1px;
            background: white;
        }
        .progressobj {
            display: flex;
            justify-content: space-between;
            height: 20px;
        }

        .jiaobiao, .jiaobiaoNew {
            position: relative;
        }

        .jiaobiao i {
            display: block;
            width: 0;
            height: 0;
            border-width: 0px 0 12px 12px;
            border-style: solid;
            border-color: transparent transparent transparent #2a8cec;
            position: absolute;
            top: 0px;
            left: 0px;
        }

        .progressobj .delfile {
            float: right;
            margin-right: 10px;
        }

        table {
            border-spacing: 0;
            border-collapse: collapse;
            display: table;
        }

        table.text-center, table.text-center td, table.text-center th {
            text-align: center;
            font-size: 12px;
        }

        .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
            border: 1px solid #cbcbcd;
            font-weight: normal;
            height: 24px;
        }

        table th {
            background: #f8f8f8;
        }

        .table-bordered {
            border: 1px solid #cbcbcd;
        }

        .table {
            width: 100%;
            max-width: 100%;
        }

        .hidden {
            display: none;
        }

        .lineOne {
            text-align: left;
        }

        .lineOne span {
            max-height: 24px;
            /*line-height: 24px;*/
            overflow: hidden;
            text-overflow: ellipsis;
            /*display: -webkit-box;*/
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        .mScrollBox {
            float: left;
            position: relative;
            overflow: hidden;
        }

        .infoReport {
            text-align: center;
            margin: 0;
            margin-bottom: 10px;
        }

        .moduleName {
            height: 20px;
            line-height: 20px;
            background: #f8f8f8;
            font-weight: bold;
            font-size: 14px;
        }
        .toggleDiv div {
            width: 50%;
            float: left;
            text-align: center;
        }

        .toggleDiv div.active {
            border-bottom: 2px solid #2289ee;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }
        .text-center{
            text-align: center;
        }
        .td-title{
            background-color: #F5F5F5;
        }

        element.style {
            width: 16%;
        }
        .table-detail {
            width: 100%;
            border-left: 1px solid #e8e8e9;
            border-top: 1px solid #e8e8e9;
            border-spacing: 0;
            /*table-layout: fixed;*/
        }
        .table-detail .td-title {
            background-color: #f5f5f5;
        }
        .table-detail td {
            border-right: 1px solid #e8e8e9;
            border-bottom: 1px solid #e8e8e9;
            padding-left: 0px !important;
            padding-right: 0px !important;
            padding-top: 0px !important;
            padding-bottom: 0px !important;
            height: 29px;
            /*line-height: 29px;*/
            text-align: center;
            position: relative;
            overflow: hidden;
            word-wrap: break-word;
        }
        .table-detail td input{
            display: inline-block;
            outline: none;
            border:0;
            /*background: #F8F8F8;*/
            padding:0;
            margin:0;
            width:93px;
            text-align: center;
            color: #2a8cec;
        }
        /* .table-detail td span{
             color: #2a8cec;
         }*/
        .table-detail td textarea,.table-detail td select{
            width:100%;
            height:100%;
            line-height: 100%;
            padding-top: 20px;
            padding-left: 6px;
            outline: none;
            resize: none;
            border: none;
            color: #2a8cec;
        }
        .table-detail td select{
            padding-top: 0px;
            padding-left:0px;
            width:auto;
            border:none;
            color: #2a8cec;
        }
        .btn {
            border-radius: 3px;
            -webkit-box-shadow: none;
            box-shadow: none;
            border: 1px solid transparent;
        }
        .btn-primary {
            background-color: #228bee;
            border-color: #127ee5;
            color: #fff;
        }
        .btn-group-sm > .btn, .btn-sm {
            padding: 5px 10px;
            font-size: 12px;
            line-height: 1.5;
            border-radius: 3px;

        }
        .model-picker-input {
            opacity: 0 !important;
            top: -9999px;
            left: -9999px;
            position: absolute;
        }

        .model-picker-span {
            position: relative;
            display: block;
            outline: 0;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            border-bottom: 1px solid #ccc;
            background-color: #fff;
            color: #ccc;
            cursor: pointer;
        }

        .model-picker-span>.placeholder {
            color: #aaa;
        }

        .model-picker-span>.arrow {
            position: absolute;
            top: 50%;
            right: 8px;
            width: 10px;
            margin-top: -3px;
            height: 5px;
            background: url(../images/drop-arrow.png) -10px -25px no-repeat;
        }

        .model-picker-span.focus,
        .model-picker-span.open {
            border-bottom-color: #46A4FF;
        }

        .model-picker-span.open>.arrow {
            background-position: -10px -10px;
        }

        .model-picker-span>.title>span {
            color: #333;
            padding: 5px;
            border-radius: 3px;
        }

        .model-picker-span>.title>span:hover {
            background-color: #f1f8ff;
        }

        .model-picker-dropdown {
            position: absolute;
            width: 315px;
            left: -9999px;
            top: -9999px;
            outline: 0;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            z-index: 999999;
            display: none;
            min-width: 330px;
            margin-bottom: 20px;
            margin-top: 10px;
        }

        .model-select-wrap {
            width: 75%;
            box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
        }

        .model-select-tab {
            border-bottom: 1px solid #ccc;
            background: #f5f5f5;
            font-size: 13px;
        }

        .model-select-tab>a {
            display: inline-block;
            padding: 4px 20px;
            border-left: 1px solid #ccc;
            border-bottom: 1px solid transparent;
            color: #4D4D4D;
            text-align: center;
            outline: 0;
            text-decoration: none;
            cursor: pointer;
            font-size: 14px;
            margin-bottom: -1px;
        }

        .model-select-tab>a.active {
            background: #fff;
            border-bottom: 1px solid #fff;
            color: #46A4FF;
        }

        .model-select-tab>a:first-child {
            border-left: none;
        }

        .model-select-tab>a:last-child.active {
            border-right: 1px solid #ccc;
        }

        .model-select-content {
            width: 100%;
            min-height: 10px;
            background-color: #fff;
            /*padding: 5px 5px;*/
        }

        .model-select {
            font-size: 13px;
        }

        .model-select dl {
            line-height: 2;
            clear: both;
            padding: 3px 0;
            margin: 0;
        }

        .model-select dt {
            position: absolute;
            width: 2.5em;
            font-weight: 500;
            text-align: right;
            line-height: 2;
        }

        .model-select dd {
            margin-left: 0;
            line-height: 2;
        }

        .model-select.province dd {
            margin-left: 3em;
        }

        .model-select a {
            display: inline-block;
            padding: 0 10px;
            outline: 0;
            text-decoration: none;
            white-space: nowrap;
            margin-right: 2px;
            text-decoration: none;
            color: #333;
            cursor: pointer;
        }

        .model-select a:hover,
        .model-select a:focus {
            background-color: #f1f8ff;
            border-radius: 2px;
            color: #46A4FF;
        }

        .model-select a.active {
            background-color: #46A4FF;
            color: #fff;
            border-radius: 2px;
        }
        td {
            color: #2a8cec;
        }
        td.td-title, td select, td .filename, td.td-module {
            color: #333;
        }
        td.td-value,span{
            padding-left: 6px;
        }
        td.td-value{
            background-color: white;
        }
        .user {
            height: 30px;
            line-height: 30px;
            max-height: 30px;
            float: left;
            text-align: left;
            /*min-width: 32px;*/
            padding-left: 1px;
            overflow: hidden;
            cursor: pointer;
        }

        .user:hover {
            background-color: #cfd4d1;
        }
        td .lookFj {
            /*width: 100%;*/
            color: #2a8cec;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            position: relative;
            cursor: pointer;
            background: none;
            padding-left: 6px;
            text-align: left;
            height: 100%;
            width: 200px;
        }
        .fujian {
            /*display: inline-block;*/
            cursor: pointer;
            padding-left: 19px;
            background: url(/dist/img/fujian.png) no-repeat 6px center;
            color: #2a8cec;
        }
        .lineTwo span {
            line-height: 16px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            text-align: left;
        }
    </style>
</head>
<body>
<section class="content" id="app" v-cloak>
    <!--<h4 class="text-center" style="margin:10px 10px;">{{money.main.title}}</h4>-->
    <div class="center" style="overflow:auto;overflow-x:hidden;padding-bottom: 51px;">
        <table class="table-detail">
            <tr>
                <td class="td-title" colspan="2" style="text-align: center;">所属公司</td>
                <td colspan="3">
                    <select v-model="params.companyId" @change="updateStationList()" class="form-control" style="height:26px;width: 130px;font-size:12px;line-height:25px;padding-top:0px;padding-bottom:0px;padding-left:6px;">
                        <option value="" selected="selected">所属公司</option>
                        <option v-for="company in companyList" v-bind:value="company.id">{{company.name}}</option>
                    </select>
                </td>
                <td class="td-title" colspan="2" style="text-align: center;">服务站名称</td>
                <td colspan="3">
                    <input type="text" v-model="params.name" style="width: 100%;height: 100%;text-align:left;padding: 5px 0"/>
                </td>
                <td class="td-title" colspan="2" style="text-align: center;">排序字段</td>
                <td colspan="3">
                    <input type="text" v-model="params.sortNo" style="width: 100%;height: 100%;text-align:left;padding: 5px 0"/>
                </td>
                <td colspan="2">
                    <input type="button" class="btn oaBtn btn-sm" style="margin-left: 10px;cursor:hand" value="新增服务站" @click="save()">
                </td>
            </tr>
        </table>
        <table class="table-detail" style="margin-top: 10px">
            <thead>
                <tr>
                    <th>服务站名称</th>
                    <th>排序字段</th>
                </tr>
            </thead>
            <template v-for="(item,i) in stationList">
            <tr>
                <td>{{item.name}}</td>
                <td>{{item.sortNo}}</td>
            </tr>
            </template>
        </table>
    </div>
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<script>window.jQuery || document.write('<script src="/dist/plugins/jQuery/jquery-2.2.3.min.js"><\/script>','<script src="/dist/plugins/vue/vue.min.js"><\/script>')</script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<!--插件JS-->
<script src="/dist/plugins/scroll/myScroll.js"></script>
<!--框架已定义 JS-->
<!--oa自定义  JS-->
<script src="/dist/js/oaApp.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/commonService.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/changeMoneyToChinese.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script src="/dist/plugins/webuploader-0.1.5/webuploader.min.js"></script>
<script>
    $.ajaxSetup({
        global: true,
        type: "POST",
        cache: false,
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        beforeSend: function () {
        },
        complete: function () {

        },
        error: function (e) {
            alert('error' + e.responseText);
        }
    });
    $.extend($.wyui, {
        postMethod: function (url, data, callback, sync, id) {
            if (!id) {
                id = "#app"
            }
            $.ajax({
                url: server.ip + url,
                async: sync ? false : true,
                data: JSON.stringify(data),
                beforeSend: function () {

                },
                complete: function () {
                    setTimeout(function () {
                    }, 1000);

                },
                success: function (r) {
                    if (!r.e.code) {
                        callback(r.data.sendData);
                    } else {
                        alert(r.e.desc);
                    }
                },
                error: function (e) {
                    alert(url + e.responseText);
                }
            });
        },
    });
</script>
<script>
    $(function () {
        $("body").on("click", ".selectModel", function (e) {
            if ($(".model-picker-dropdown").is(":hidden")) {
                $(".model-picker-dropdown").css({
                    "width": $(this).outerWidth() + "px",
                    "left": $(this).offset().left,
                    "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                }).show();
                e.stopPropagation();
            } else {
                $(".model-picker-dropdown").hide();
            }
        });
        $("body").on("click", ".model-select-tab a", function (e) {
            $(this).parent().find("a").removeClass("active");
            $(this).addClass("active");
            var boxName=$(this).attr("data-count");
            $(".model-select").hide();
            $(".model-select-content"+" ."+boxName).show();
        });
        $("body").on("click", ".model-select  a", function (e) {
            if($(this).hasClass("active")){return false;}
            $(this).parent().find("a").removeClass("active");
            var id=$(this).attr("attr-id");
            $(this).addClass("active");
            if($(this).parents(".model-select").hasClass("type")){
                $(".model-select-tab a").removeClass("active");
                $(".model-select-tab a[data-count=brand]").addClass("active");
                $(".model-select").hide();
                app.getBrand(id);
                $(".model-select-content .brand").show();

            }else if($(this).parents(".model-select").hasClass("brand")){
                $(".model-select-tab a").removeClass("active");
                var id=$(this).attr("attr-id");
                $(".model-select-tab a[data-count=model]").addClass("active");
                $(".model-select").hide();
                app.getModel(id);
                $(".model-select-content .model").show();
            }else{
                app.modelName=$(this).text();
                app.modelId=id;
                $(".model-picker-dropdown").hide();
            }
        })
        $("body").on("click", ".model-picker-dropdown", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".model-picker-dropdown").hide();
        });
    });
</script>
<script type="text/javascript">
    // var api = frameElement.api, W = api.opener;
    function refresh() {
        //app.getById();
        setTimeout(function(){
            //这个可以关闭安卓系统的手机
            document.addEventListener('WeixinJSBridgeReady', function(){ WeixinJSBridge.call('closeWindow'); }, false);
            //这个可以关闭ios系统的手机
            WeixinJSBridge.call('closeWindow');
        }, 100)
    }
    var app = new Vue({
        el:'#app',
        data:{
            params:{
                name:'',
                companyId:'',
                sortNo:''
            },
            companyList:[],
            stationList:[]
        },
        methods:{
            save:function () {
                var that = this;
                if(""== that.params.name){
                    alert("请输入服务站名称");
                    return ;
                }
                if(""== that.params.companyId){
                    alert("请选择所属公司");
                    return ;
                }
                if(""== that.params.sortNo){
                    alert("请输入排序信息");
                    return ;
                }
                if(!that.params.sortNo.match(/\d+/g)){
                    alert("排序字段必须为数字");
                    return ;
                }
                $.wyui.postMethod("/serveStation/save.json", this.params, function (data) {
                    if(data.id != undefined){
                        alert("保存成功");
                    }
                });
            },
            updateStationList:function () {
                var that = this;
                $.wyui.postMethod("/serveStation/getServeStationList.json", {companyId:this.params.companyId}, function (data) {
                    that.stationList = data.records;
                });
            }
        },
        mounted: function () {
            var that = this;
            $.wyui.postMethod("/company/getCompanyList.json", {}, function (data) {
               that.companyList = data;
           });
        }
    });
</script>
</body>
</html>